﻿using System.ComponentModel.DataAnnotations;

namespace Mvc.Sample.Models;

public class TodoItem
{
    public int Id { get; set; }

    [Required(ErrorMessage = "Title is required")] // 必填验证
    public string Title { get; set; } = null!;
    
    [Required(ErrorMessage = "Description is required")] // 必填验证
    public string Description { get; set; }= null!;
    public bool IsDone { get; set; }
    
    [Required(ErrorMessage = "DueDate is required")] // 日期类型验证
    public DateTime DueDate { get; set; }
}